package com.woniu.sharepark.leasesystem.common.dao;

import com.woniu.sharepark.leasesystem.common.pojo.OrderForm;
import org.apache.ibatis.annotations.Param;


import java.util.List;

/**
 * 订单信息数据访问层接口
 * @author xin
 * @date 2019/6/1 12:35
 */
public interface OrderFormDAO {
    /**
    * 通过主键删除订单信息
    * @title deleteByPrimaryKey
    * @param oId 主键
    * @return: int
    * @author xin
    * @date 2019/6/1 12:36
    */
    int deleteByPrimaryKey(Integer oId);

    /**
    * 插入订单信息
    * @title insert
    * @param record 订单信息
    * @return: int
    * @author xin
    * @date 2019/6/1 12:36
    */
    int insert(OrderForm record);

    /**
    * 动态插入订单信息
    * @title insertSelective
    * @param record 订单信息
    * @return: int
    * @author xin
    * @date 2019/6/1 12:35
    */
    int insertSelective(OrderForm record);

    /**
    * 通过主键查询订单信息
    * @title selectByPrimaryKey
    * @param oId 主键id
    * @return: com.woniu.sharepark.pojo.OrderForm
    * @author xin
    * @date 2019/6/1 12:35
    */
    OrderForm selectByPrimaryKey(Integer oId);

    /**
    * 通过主键动态修改订单信息
    * @title updateByPrimaryKeySelective
    * @param record 订单信息
    * @return: int
    * @author xin
    * @date 2019/6/1 12:35
    */
    int updateByPrimaryKeySelective(OrderForm record);

    /**
    * 通过主键修改订单信息
    * @title updateByPrimaryKey
    * @param record 订单信息
    * @return: int
    * @author xin
    * @date 2019/6/1 12:35
    */
    int updateByPrimaryKey(OrderForm record);

    /**
    * 通过cid集合查询订单（正在出租中）
    * @title selectByCid
    * @param cids 车位号集合
    * @return: java.util.List<com.woniu.sharepark.leasesystem.common.pojo.OrderForm>
    * @author xin
    * @date 2019/6/6 10:28
    */
    List<OrderForm> selectByCids(@Param("cids") String cids);


    /**
    * 通过cid集合查询订单（已完成）
    * @title selectOrderByCids
    * @param cids 车位号集合
    * @return java.util.List<com.woniu.sharepark.leasesystem.common.pojo.OrderForm>
    * @author xin
    * @date 2019/6/20 18:26
    */
    List<OrderForm> selectOrderByCids(@Param("cids") String cids);

    /**
    * 查询所有已完成订单
    * @title selectAllOrder
    * @return java.util.List<com.woniu.sharepark.leasesystem.common.pojo.OrderForm>
    * @author xin
    * @date 2019/6/20 18:27
    */
    List<OrderForm> selectAllOrder();


    /**
    * 通过订单编号查找订单
    * @title selectOrderByNumber
    * @param getoNumber
    * @return com.woniu.sharepark.leasesystem.common.pojo.OrderForm
    * @author DELL
    * @date 2019/6/4 15:31
    **/

    OrderForm selectOrderByNumber(String getoNumber);

    /**
    * 修改订单状态
    * @title updateStatus
    * @param orderFormId, orderStatus
     * @param  orderStatus
    * @return int
    * @author DELL
    * @date 2019/6/4 16:46
    **/

    int updateStatus(@Param("orderFormId") Integer orderFormId, @Param("orderStatus") String orderStatus);

    /**
    * 分页查询历史订单信息 按照订单结束时间排序
    * @title selectConsumptionList
    * @param currentPage, pageSize
    * @return java.util.List<com.woniu.sharepark.leasesystem.common.pojo.OrderForm>
    * @author DELL
    * @date 2019/6/4 19:32
    **/

    List<OrderForm> selectConsumptionList(@Param("currentPage") Integer currentPage,@Param("pageSize") Integer pageSize);

    /**
    * 查询租车日期截至订单
    * @title selectByEndOrderForm
    * @param nowDate,formatAgo
    * @return java.util.List<com.woniu.sharepark.leasesystem.common.pojo.OrderForm>
    * @author DELL
    * @date 2019/6/11 10:55
    **/

    List<OrderForm> selectByEndOrderForm(@Param("nowDate") String nowDate);

    /**
    * 查询订单new
    * @title selectOrder
    * @param id
    * @return com.woniu.sharepark.leasesystem.common.pojo.OrderForm
    * @author DELL
    * @date 2019/6/14 22:06
    **/
    OrderForm selectOrder(Integer id);

    /**
    * 查询当前用户已完成订单信息,or正在进行订单信息
    * @title findAllOrderForm
    * @param carId
     * @param orderStuts
    * @return java.util.List
    * @author DELL
    * @date 2019/6/15 13:09
    **/
    List<OrderForm> findAllOrderForm(@Param("carId") Integer carId,@Param("orderStuts") String orderStuts);

    /**
    * 按订单号查找订单
    * @title selectOrderByOnumber
    * @param orderNumber
    * @return com.woniu.sharepark.leasesystem.common.pojo.OrderForm
    * @author DELL
    * @date 2019/6/16 18:07
    **/

    OrderForm selectOrderByOnumber(String orderNumber);

    /**
    * 查询未使用代金券的订单
    * @title findOrderNoVoucher
    * @param carId, ordereStuats
    * @return java.util.List
    * @author DELL
    * @date 2019/6/17 11:02
    **/

    List findOrderNoVoucher(@Param("carId") Integer carId,@Param("orderStuts") String orderStuts);

    /**
    * 查询
    * @title coountSuccessOrder
    * @param uId
    * @return java.lang.Integer
    * @author DELL
    * @date 2019/6/20 15:44
    **/

    Integer coountSuccessOrder(Integer uId);

    /**
     * 返回当前用户所有订单
     *
     * @param uid Param Description
     * @return java.util.List
     * @Author Zongjie.Li
     * @Date 2019/6/20
     * @Version 1.0
     */
    List findAllOrder(Integer uid);
}